package com.banca2.bracketplant.pojo;

import com.alibaba.fastjson.JSONObject;
import com.banca2.bracketplant.common.ResponseStatus;

/*********************************************************************<br>
 * BncRequest.java													 *<br>
 * 功 能：封装服务器返回结果的通用格式										 *<br>
 * 																	 *<br>
 *  Ver   变更日期        负责人  					变更内容                        			 *<br>
 * ───────────────────────────────────────────────────────────────── *<br>
 * V0.01 2015-6-1	ZQ      				    创建					 *<br>
 * 																	 *<br>
 * Copyright (c) 2015 StarFollower Corporation. All rights reserved. *<br>
 *┌─────────────────────────────────────────────────────────────────┐*<br>
 *│　此技术信息为本团队机密信息，未经本团队书面同意禁止向第三方披露．　				│*<br>
 *│　版权所有：StarFollower　　　　　　　　　　                     　					│*<br>
 *└─────────────────────────────────────────────────────────────────┘*<br>
 *********************************************************************/
public class BncResponse {
	
	// 请求结果的状态
	private ResponseStatus status;
	
	// 请求返回的数据
	private JSONObject data;

	public BncResponse() {
	}

	public BncResponse(ResponseStatus status) {
		super();
		this.status = status;
		this.data = null;
	}

	public BncResponse(ResponseStatus status, JSONObject data) {
		super();
		this.status = status;
		this.data = data;
	}

	public ResponseStatus getStatus() {
		return status;
	}

	public void setStatus(ResponseStatus status) {
		this.status = status;
	}

	public JSONObject getData() {
		return data;
	}

	public void setData(JSONObject data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "BncRequest [status=" + status + ", data=" + data + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((data == null) ? 0 : data.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BncResponse other = (BncResponse) obj;
		if (data == null) {
			if (other.data != null)
				return false;
		} else if (!data.equals(other.data))
			return false;
		if (status != other.status)
			return false;
		return true;
	}

}
